package com.teamfractal.fracdustry.common.block.init;

import com.teamfractal.fracdustry.common.block.impl.connectivities.FDCableBlock;
import com.teamfractal.fracdustry.common.block.impl.generators.*;
import com.teamfractal.fracdustry.common.block.impl.machines.FDElectricFurnaceBlock;
import com.teamfractal.fracdustry.common.block.impl.machines.FDOreProcessorBlock;
import com.teamfractal.fracdustry.common.block.impl.misc.FDResearchDeskBlock;
import com.teamfractal.fracdustry.common.fluid.init.FDFluids;
import com.teamfractal.fracdustry.common.fluid.init.RedactedLiquidBlock;
import com.teamfractal.fracdustry.common.util.FDRegistryHandler;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.OreBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.Material;
import net.minecraftforge.fmllegacy.RegistryObject;


public class FDBlocks
{
    public static RegistryObject<Block> blockBauxiteOre;
    public static RegistryObject<Block> blockCassiteriteOre;
    public static RegistryObject<Block> blockIlmeniteOre;
    public static RegistryObject<Block> blockRareEarthOre;
    public static RegistryObject<Block> blockSpodumeneOre;
    public static RegistryObject<Block> blockDeepslateBauxiteOre;
    public static RegistryObject<Block> blockDeepslateCassiteriteOre;
    public static RegistryObject<Block> blockDeepslateIlmeniteOre;
    public static RegistryObject<Block> blockDeepslateRareEarthOre;
    public static RegistryObject<Block> blockDeepslateSpodumeneOre;

    public static RegistryObject<Block> blockCable;
    public static RegistryObject<Block> blockKineticGenerator;
    public static RegistryObject<Block> blockThermalGenerator;
    public static RegistryObject<Block> blockMicrowaveGenerator;
    public static RegistryObject<Block> blockSolarGenerator;
    public static RegistryObject<Block> blockVawt;

    public static RegistryObject<Block> blockElectricFurnace;
    public static RegistryObject<Block> blockOreProcessor;

    public static RegistryObject<Block> blockResearchDesk;

    public static RegistryObject<RedactedLiquidBlock> fluidPetroleum;


    public static void register(){
        blockBauxiteOre = FDRegistryHandler.Blocks.register("bauxite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.STONE).strength(2).requiresCorrectToolForDrops()));
        blockCassiteriteOre = FDRegistryHandler.Blocks.register("cassiterite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.STONE).strength(2).requiresCorrectToolForDrops()));
        blockIlmeniteOre = FDRegistryHandler.Blocks.register("ilmenite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.STONE).strength(2).requiresCorrectToolForDrops()));
        blockRareEarthOre = FDRegistryHandler.Blocks.register("rare_earth_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.STONE).strength(2).requiresCorrectToolForDrops()));
        blockSpodumeneOre = FDRegistryHandler.Blocks.register("spodumene_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.STONE).strength(2).requiresCorrectToolForDrops()));
        blockDeepslateBauxiteOre = FDRegistryHandler.Blocks.register("deepslate_bauxite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(3).sound(SoundType.DEEPSLATE).strength(2).requiresCorrectToolForDrops()));
        blockDeepslateCassiteriteOre = FDRegistryHandler.Blocks.register("deepslate_cassiterite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(3).sound(SoundType.DEEPSLATE).strength(2).requiresCorrectToolForDrops()));
        blockDeepslateIlmeniteOre = FDRegistryHandler.Blocks.register("deepslate_ilmenite_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(3).sound(SoundType.DEEPSLATE).strength(2).requiresCorrectToolForDrops()));
        blockDeepslateRareEarthOre = FDRegistryHandler.Blocks.register("deepslate_rare_earth_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(2).sound(SoundType.DEEPSLATE).strength(2).requiresCorrectToolForDrops()));
        blockDeepslateSpodumeneOre = FDRegistryHandler.Blocks.register("deepslate_spodumene_ore", () -> new OreBlock(BlockBehaviour.
                Properties.of(Material.STONE).explosionResistance(3).sound(SoundType.DEEPSLATE).strength(2).requiresCorrectToolForDrops()));

        blockCable = FDRegistryHandler.Blocks.register("cable", FDCableBlock::new);
        blockKineticGenerator = FDRegistryHandler.Blocks.register("kinetic_generator", FDKineticGeneratorBlock::new);
        blockThermalGenerator = FDRegistryHandler.Blocks.register("thermal_generator", FDThermalGeneratorBlock::new);
        blockMicrowaveGenerator = FDRegistryHandler.Blocks.register("microwave_generator", FDMicrowaveGeneratorBlock::new);
        blockSolarGenerator = FDRegistryHandler.Blocks.register("solar_generator", FDSolarGeneratorBlock::new);
        blockVawt = FDRegistryHandler.Blocks.register("vawt", FDVawtBlock::new);

        blockElectricFurnace = FDRegistryHandler.Blocks.register("electric_furnace", FDElectricFurnaceBlock::new);
        blockOreProcessor = FDRegistryHandler.Blocks.register("ore_processor", FDOreProcessorBlock::new);

        blockResearchDesk = FDRegistryHandler.Blocks.register("research_desk", FDResearchDeskBlock::new);

        fluidPetroleum = FDRegistryHandler.Blocks.register("petroleum", () -> new RedactedLiquidBlock(FDFluids.petroleumFluidStill, Block.Properties.of(Material.WATER).noCollission().strength(100.0F, 100.0F).noDrops()));
    }
}
